Skip to content

Conversation

martynp
Copy link

@martynp martynp commented Apr 7, 2024

The intent is to provide access to the additional fields that a JWK may contain to avoid re-processing the JWK file to get at that data.

This MR will need to wait for the next release of serdect (for serde derive features) and I think elliptic-curves needs updating to make it usable? (at least the master branch emits a load of primeorder related missing trait implementations).

The main change is to add the optional fields to the JwkEcKey struct and make all fields public. I replaced the custom (de)serializer to use the derive based one, it should now be order agnostic but still enforce "EC" key types. It should also cope with any additional fields gracefully - non-standard fields would still need to be decoded separately.

I have also added in a thumbprint method which is very useful.

@martynp
Copy link
Author

martynp commented Apr 7, 2024

#1247
RustCrypto/JOSE#86

@tarcieri
Copy link
Member

I wonder if perhaps we should try to migrate from this built-in implementation to https://github.com/RustCrypto/JOSE/tree/master/jose-jwk

@Erik1000
Copy link

I think we shoud not include optional fields but just allow unknown fields. Users can then use #[serde(flatten)] and a container type to get additional parameters from the JSON Object/JWK

@tarcieri
Copy link
Member

Oh sorry, I didn't notice this was open before migrating the implementation.

@martynp can you reopen this against https://github.com/RustCrypto/JOSE/blob/master/jose-jwk/src/legacy.rs ?

@tarcieri tarcieri closed this Aug 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants